export const mixin = {
  methods: {
    opeTypeStr (opeType, emptyOrHeavy) {
      const flow11 = emptyOrHeavy === 1 ? '-空箱' : (emptyOrHeavy === 2 ? '-重箱' : '')
      if (opeType === 0) return '生成订单'
      else if (opeType === 1) return '操作派单'
      else if (opeType === 2) return '调度接单'
      else if (opeType === 3) return '调度派单'
      else if (opeType === 4) return '完成订单-异常结束'
      else if (opeType === 5) return '作废'
      else if (opeType === 10) return '司机接单'
      else if (opeType === 11) return '开始订单-提箱离港' + flow11
      else if (opeType === 12) return '开始订单-空车离港' + flow11
      else if (opeType === 13) return '开始订单-套箱接单' + flow11
      else if (opeType === 14 || opeType === 15) return '到达门点'
      else if (opeType === 16 || opeType === 17) return '完成装卸'
      else if (opeType === 18) return '上传货运凭证'
      else if (opeType === 19) return '完成订单-到港'
      else if (opeType === 20) return '完成订单-套箱接单'
      else if (opeType === 21) return '异常处理-故障报警'
      else if (opeType === 22) return '异常处理-放空'
      else if (opeType === 23) return '取消派单'
    },
    // 改派 <!-- 司机待接单(指定单个司机)、司机待出发 --> 1.2运输中的订单增加【改派】功能
    isChangeDriver (item) {
      return (item.status === 3 && item.dispatchCount === 1) || item.status === 4 || item.status === 5
    },
    // 指派/派单 <!-- 司机待接单、待派单 -->
    isAssignDriver (item) {
      return (item.status === 3 && item.dispatchCount > 1) || item.status === 2
    }
  }
}
